Texture2D diffuse;

cbuffer Screen
{
	matrix	mProj;
};

cbuffer Model
{
	matrix	mWorld;
	float4	mUvShift;
};

cbuffer Camera
{
	matrix	mView;
};

SamplerState Linear
{
	Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Wrap;
    AddressV = Wrap;
};

struct VsInput
{
	float2	mPos : POSITION;
	float2	mUv : UV;
};

struct PsInput
{
	float4	mPos : SV_POSITION;
	float2	mUv : TEXCOORD0;
};

struct PsOutput
{
	float4	mColor : SV_Target;
};

PsInput VS(VsInput input)
{
	PsInput output = (PsInput)0;
	output.mPos = float4(input.mPos, 0.5f, 1.0f);
	output.mPos = mul(output.mPos, mWorld);
	output.mPos = mul(output.mPos, mView);
	output.mPos = mul(output.mPos, mProj);
	output.mUv = input.mUv + mUvShift.xy;
	return output;
}

PsOutput PS(PsInput input)
{
	PsOutput output = (PsOutput)0;
	output.mColor = diffuse.Sample(Linear, input.mUv);
	//output.mColor = float4(input.mUv, 0.0f, 1.0f);
	return output;
}
